<!-- 购物车合计按钮 -->
<template>
  <div class="cart-list-bottom">
    <div>
      共
      <span>({{totalNumber}})</span>件商品
    </div>
    <div>
      总计:
      <span>￥{{(totalPrice).toFixed(2)}}</span>
    </div>
    <!-- <el-button
      size="mini"
      @click="jumpQuotation"
      :type=" this.cartlist.length  ? 'primary' : 'info'"
      :disabled="!this.cartlist.length > 0 ? true : false "
    >报价单</el-button>-->
    <!-- <van-button
      color="linear-gradient(to right, yellow, red)"
      @click="jumpSettlement"
      size="small"
      :disabled="!this.cartlist.length > 0 ? true : false "
    >去下单</van-button> -->
  </div>
</template>

<script>
import CartListVue from "./CartList.vue";
export default {
  props: {
    totalNumber: Number,
    totalPrice: Number,
    cartlist:{}
  },
  data() {
    return {
      loading: false // 结算按钮
    };
  },
  methods: {
    //点击报价单
    // async jumpQuotation() {
    //   let user_id = this.$store.state.user_id;
    //   await this.$http({
    //     method: "post",
    //     url: "index/api/authUser",
    //     data: {
    //       user_id
    //     }
    //   })
    //     .then(res => {
    //       console.log(res);
    //       if (res.data.State.Code == 200) {
    //         this.$store.commit("QuotationData", this.cartlist);
    //         console.log(this.$store.state.QuotationData);
    //         this.$router.push("/quotation");
    //       } else {
    //  this.$Notify({ type: "danger", message: "注请到个人中心 完善用户名称 以及账户安全中的邮箱绑定..." });
    //       }
    //     })
    //     .catch(err => {
    //       console.log(err);
    //     });
    // },
    //点击去结算
    async jumpSettlement() {
      this.loading = true;
      let user_id = window.localStorage.getItem('user_id');
      let CartArray = {};
      this.$store.commit("SettlementData", this.cartlist);
       
      this.$router.push("/myorder");
      this.loading = false;
    }
  }
};
</script>
<style lang='scss' scoped>
.cart-list-bottom {
  width: 100%;
  height: 30px;
  position: fixed;
  bottom: 1.33rem;
  left: 0;
  right: 0;
  display: flex;
  div {
    flex: 1;
    text-align: center;
    line-height: 32px;
    background-color: rgba($color: rgb(25, 137, 250), $alpha: 1);
    color:#fff;
    span {
      color: red;
      font-size: 18px;
    }
  }
}
</style>